<template>
    <div>
      <h2 style="color: grey">信息发布管理</h2><br>

      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="">
          <el-input v-model="formInline.newsheadline" placeholder="信息标题查询"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="selectAllNewsPortal">查询</el-button>
        </el-form-item>
      </el-form>

      <el-table
        :data="tableData"
        border
        style="width:95%;margin-left:auto;margin-right: auto"
        fit
        @row-click="selectNewsPortalInfo"

      >
        <el-table-column
          prop="news_headline"
          label="信息标题"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="news_subtitle"
          label="信息副标题"
          align="center"
        >
        </el-table-column>

        <el-table-column
          prop="news_releasetimeStr"
          label="发布时间"
          align="center"
        >
        </el-table-column>

        <el-table-column
          prop="u_acount"
          label="发布人"
          align="center"
        >
        </el-table-column>


        <el-table-column
          label="操作"
          align="center"
          prop="u_status"
        >
           <el-button type="primary" plain @click="">修改</el-button>
           <el-button type="danger" plain @click="" >删除</el-button>
        </el-table-column>

      </el-table>
    </div>
</template>

<style>
    body {
        background-color: #F5F5F5;
    }
</style>

<script>
    export default {
      name:'myPortalInfoRelease',
        data() {
            return {
              tableData: [
              ],
              formInline: {
                newsheadline: '',

              }
            }
        },
      methods:{
        selectAllNewsPortal:function () {
          this.$axios({
            url: `/api/manOperat/selectAllNewsPortal/` + "?news_headline="+this.formInline.newsheadline,
            method: 'get',
          }).then(tealist => {  // 请求成功
            this.tableData = tealist.data;

          }).catch(error => {  // 请求失败

          });

        },

        //查看行发布信息
        selectNewsPortalInfo: function (newsinfo) {
          this.$axios({
            url: `/api/manOperat/selectNewsPortalInfo/` + "?u_acount=" + newsinfo.u_acount,
            method: 'get',
          }).then(teaInfoByCode => {  // 请求成功
            this.u_acount = teaInfoByCode.data[0].u_acount;
          }).catch(error => {  // 请求失败

          });
        },

      },
      created() {
        this.selectAllNewsPortal();
      }
    }
</script>
